3.107 \(\int \frac{a+b x^2}{1+x^2} \, dx\)

Optimal. Leaf size=12 \[ (a-b) \tan ^{-1}(x)+b x \]

[Out]

b*x + (a - b)*ArcTan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0063076, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {388, 203} \[ (a-b) \tan ^{-1}(x)+b x \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x^2)/(1 + x^2),x]

[Out]

b*x + (a - b)*ArcTan[x]

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{a+b x^2}{1+x^2} \, dx &=b x-(-a+b) \int \frac{1}{1+x^2} \, dx\\ &=b x+(a-b) \tan ^{-1}(x)\\ \end{align*}

Mathematica [A]  time = 0.0062263, size = 12, normalized size = 1. \[ (a-b) \tan ^{-1}(x)+b x \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^2)/(1 + x^2),x]

[Out]

b*x + (a - b)*ArcTan[x]

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 14, normalized size = 1.2 \begin{align*} bx+\arctan \left ( x \right ) a-\arctan \left ( x \right ) b \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)/(x^2+1),x)

[Out]

b*x+arctan(x)*a-arctan(x)*b

________________________________________________________________________________________

Maxima [A]  time = 1.51263, size = 16, normalized size = 1.33 \begin{align*} b x +{\left (a - b\right )} \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(x^2+1),x, algorithm="maxima")

[Out]

b*x + (a - b)*arctan(x)

________________________________________________________________________________________

Fricas [A]  time = 1.20739, size = 34, normalized size = 2.83 \begin{align*} b x +{\left (a - b\right )} \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(x^2+1),x, algorithm="fricas")

[Out]

b*x + (a - b)*arctan(x)

________________________________________________________________________________________

Sympy [C]  time = 0.288837, size = 26, normalized size = 2.17 \begin{align*} b x - \frac{i \left (a - b\right ) \log{\left (x - i \right )}}{2} + \frac{i \left (a - b\right ) \log{\left (x + i \right )}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)/(x**2+1),x)

[Out]

b*x - I*(a - b)*log(x - I)/2 + I*(a - b)*log(x + I)/2

________________________________________________________________________________________

Giac [A]  time = 1.15347, size = 16, normalized size = 1.33 \begin{align*} b x +{\left (a - b\right )} \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(x^2+1),x, algorithm="giac")

[Out]

b*x + (a - b)*arctan(x)